using Letter.IO.Scheduler;
using System.Buffers;
using ePipe;

namespace Letter.Net;

public static class ChannelSettingsProvider
{
    public static IChannelSettings CreateSettings(
                                                    PipeScheduler scheduler, PipeOptions<byte> inputOptions,
                                                    PipeOptions<byte> outputOptions, MemoryPool<byte> memoryPool)
    {
        return new ChannelSettings()
        {
            Scheduler = scheduler,
            InputOptions = inputOptions,
            OutputOptions = outputOptions,
            MemoryPool = memoryPool
        };
    }

    public static IChannelSettingsAllotter CreateSettingsAllotter(MemoryPool<byte> memoryPool, long  maxReadBufferSize, long maxWriteBufferSize)
    {
        return new ChannelSettingsAllotter(memoryPool, maxReadBufferSize, maxWriteBufferSize);
    }
}